<template>
	<view>
		<view class="show-tips" v-if="status>-1&&interview_status==-1">
			<view v-if="status">
				审核时间：{{$tools.formatTime(verify_time,'date')}}
			</view>
			<view>
				审核状态：{{status==0?'待审核':''}}{{status==1?'通过':''}}{{status==2?'拒绝':''}}
			</view>
			<view v-if="status==2">
				拒绝原因：{{verify_remarks}}
			</view>
		</view>
		<!-- <view class="opt-block" v-if="status==1&&(interview_status==-1||interview_status==4)">
			<button type="default" class="btn" 
				@click.stop="updateStatus('interview_status',0)">约面试</button>
		</view>
		<view class="show-tips" v-if="status==1&&interview_status>-1">
			<view v-if="interview_status">
				{{interview_status==4?'取消':'面试'}}时间：{{$tools.formatTime(interview_time)}}
			</view>
			<view>
				面试状态：{{interview_status==0?'等待确认面试':''}}{{interview_status==1?'已约面试':''}}{{interview_status==2?'面试通过':''}}{{interview_status==3?'已拒绝':''}}{{interview_status==4?'已取消':''}}
			</view>
			<view v-if="interview_status==3">
				原因：{{interview_result}}
			</view>
		</view> -->
		<form @submit="updateData">
			<view class="form-item">
				<view class="title"><text style="color: red;">*</text>通知ID</view>
				<input placeholder="点我绑定通知" type="text" name="mp_openid" :value="userInfo.mp_openid?'已绑定':'点我绑定通知'" disabled
						@click="$tools.toPage('pages/mine/bindMpOpenid?phone='+phone)" />
				<input type="text" v-show="false" name="mp_openid" :value="userInfo.mp_openid" />
			</view>
			<view class="title-line">
				个人信息
			</view>
			<view class="top">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>头像照片</view>
				<view class="right">
					<image :src="avatarUrl" v-if="avatarUrl"
						@click.stop="status==1||status==0?'':chooseImg('avatarUrl')"></image>
					<view class="add-opt" v-else @click.stop="status==1||status==0?'':chooseImg('avatarUrl')"><text
							class="iconfont iconcamera_icon"></text></view>
					<input type="text" v-show="false" name='avatarUrl' :value="avatarUrl" />
				</view>
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>姓名</view>
				<input class="text" name="name" maxlength="10" :disabled="status==1||status==0" placeholder="请输入真实姓名"
					:value="name" />
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>身份证</view>
				<input class="text" name="identity_card" maxlength="18" :disabled="status==1||status==0"
					placeholder="请输入身份证号" :value="identity_card" />
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>性别</view>
				<text style="margin-left: 25rpx;margin-right: 70%;color: #555;"
					v-if="status==1||status==0">{{gender==1?'男':''}}{{gender==2?'女':''}}</text>
				<radio-group style="width: 75%;" name="gender" v-else>
					<label style="margin-right: 30rpx;">
						<radio value="1" :color="$scss.themeColor" style="transform: scale(0.8);"
							:checked="gender==1" />
						<text style="font-size: 30rpx;">男</text>
					</label>
					<label>
						<radio value="2" :color="$scss.themeColor" style="transform: scale(0.8);"
							:checked="gender==2" />
						<text style="font-size: 30rpx;">女</text>
					</label>
				</radio-group>
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>手机</view>
				<input type="text" name="phone" maxlength="11" placeholder="请点击自动填写" disabled="" :value="phone"
					style="width: 50%;margin-right: 175rpx;" />
				<view class="opt-btn" @click="$tools.toPage('pages/login/login?opt=phone')" v-if="status!=1&&status!=0">
					自动填写</view>
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>微信</view>
				<input type="text" name="wechat" maxlength="28" :disabled="status==1||status==0" placeholder="请输入微信号"
					:value="wechat" />
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>QQ</view>
				<input type="number" name="qq" maxlength="20" :disabled="status==1||status==0" placeholder="请输入qq号"
					:value="qq" />
			</view>
			<view class="form-item">
				<view class="title"><text v-if="status!=1" style="color: red;">*</text>地区</view>
				<input type="text" style="width: 510rpx;color: #555;" v-if="status==1||status==0" :value="region"
					disabled="" />
				<picker mode="region" data-k="region" @change="setAddress" v-else>
					<input type="text" style="width: 510rpx;color: #555;" name="region" :value="region" disabled="" />
				</picker>
			</view>
			<view class="form-item">
				<view class="title"><text class="title-city-text"><text v-if="status!=1"
							style="color: red;">*</text>地址</text></view>
				<input name="address" :disabled="status==1||status==0" placeholder="请输入详细地址" maxlength="100" type="text"
					:value="address" />
			</view>
			<view class="form-item">
				<view class="title"><text class="title-city-text">获奖经历</text></view>
				<textarea name="win_award" maxlength="100" :disabled="status==1||status==0"
					placeholder="请输入获奖经历不少于10个字,不超过100个字" :value="win_award" />

			</view>
			<view class="form-item">
				<view class="title"><text class="title-city-text">自我评价</text></view>
				<textarea name="self_evaluate" maxlength="80" :disabled="status==1||status==0"
					placeholder="请输入自我评价不少于10个字,不超过80个字" :value="self_evaluate" />
			
			</view>
			<view class="title-line">
				教学信息
			</view>
			<view class="form-item">
				<view class="title"><text class="title-city-text"><text v-if="status!=1"
							style="color: red;">*</text>授课年级</text></view>
				<input name="teach_grade_title" placeholder="点我选择年级" type="text" :value="teach_grade_title" disabled
					@click.stop="status==1||status==0?'':$tools.toPage('pages/teacher/selectList?opt=grade&num=10')" />
			</view>
			<view class="form-item">
				<view class="title"><text class="title-city-text"><text v-if="status!=1"
							style="color: red;">*</text>授课科目</text></view>
				<input name="teach_course_title" placeholder="点我选择科目" type="text" :value="teach_course_title" disabled
					@click.stop="status==1||status==0?'':$tools.toPage('pages/teacher/selectList?opt=course&num=10')" />
			</view>
			<!-- <view class="form-item">
				<view class="title"><text class="title-city-text"><text v-if="status!=1"
							style="color: red;">*</text>授课区域</text></view>
				<input type="text" placeholder="点我选择区域" name="teach_area" :value="teach_area" disabled
					@click.stop="status==1||status==0?'':$tools.toPage('pages/teacher/selectArea')" />
			</view> -->
			<view class="form-item">
				<view class="title"><text class="title-city-text"><text v-if="status!=1"
							style="color: red;">*</text>空闲时间</text></view>
				<input type="text" name="free_time" :value="free_time" v-show="false" />
				<input type="text" placeholder="点我选择时间" :value="free_time?'已选择':'点我选择时间'" disabled
					@click.stop="status==1||status==0?'':$tools.toPage('pages/teacher/selectTime')" />
			</view>
			<view class="title-line" style="position: relative;text-align: center;">
				教育背景 <view class="opt-btn" @click.stop="addEduBackground" v-if="status!=1">添加学历</view>
			</view>
			<view class="" v-for="(v,k) in edu_background" :key="k">
				<view style="position: relative;text-align: center;margin-top: 30rpx;">
					学历{{k+1}}
					<view class="opt-btn" style="background: #FF3F34;" v-if="k>0&&status!=1"
						@click.stop="del('edu_background',k)">
						删除</view>
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>时间</text></view>
					<view style="color: #666;font-size: 28rpx;" v-if="status==1||status==0">{{v.date_start}}</view>
					<picker mode="date" data-arr='edu_background' :data-k="k" v-else data-field='date_start'
						@change="setData">
						<view style="color: #666;font-size: 28rpx;">{{v.date_start}}</view>
					</picker>
					~
					<view style="color: #666;font-size: 28rpx;" v-if="status==1||status==0">{{v.date_end}}</view>
					<picker mode="date" data-arr='edu_background' :data-k="k" v-else data-field='date_end'
						@change="setData">
						<view style="color: #666;font-size: 28rpx;">{{v.date_end}}</view>
					</picker>
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>学校</text></view>
					<input v-model="v.school" :disabled="status==1||status==0" placeholder="请输入毕业学校" maxlength="50"
						type="text" />
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>专业</text></view>
					<input v-model="v.major" :disabled="status==1||status==0" placeholder="请输入专业" maxlength="30"
						type="text" />
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>学历</text></view>
					<input v-model="v.diploma" :disabled="status==1||status==0" placeholder="请输入学历" maxlength="10"
						type="text" />

				</view>
			</view>
			<view class="title-line" style="position: relative;text-align: center;">
				教学经历 <view class="opt-btn" @click.stop="addTeachingExperience" v-if="status!=1">添加经历</view>
			</view>
			<view class="" v-for="(v,k) in teach_experience" :key="k">
				<view style="position: relative;text-align: center;margin-top: 30rpx;">
					经历{{k+1}}
					<view class="opt-btn" style="background: #FF3F34;" v-if="k>0&&status!=1"
						@click.stop="del('teach_experience',k)">删除</view>
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>时间</text></view>
					<input v-model="v.time" placeholder="请输入时间" :disabled="status==1||status==0" maxlength="20"
						type="text" />
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>辅导年级</text>
					</view>
					<input v-model="v.tutor_grade" placeholder="请输入辅导年级" :disabled="status==1||status==0" maxlength="50"
						type="text" />
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>机构名称</text>
					</view>
					<input v-model="v.institution_title" placeholder="无机构可填写个人家教" :disabled="status==1||status==0"
						maxlength="50" type="text" />
				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text"><text v-if="status!=1"
								style="color: red;">*</text>学生情况</text></view>
					<input v-model="v.student" placeholder="请输入学生情况" maxlength="50" :disabled="status==1||status==0"
						type="text" />

				</view>
				<view class="form-item">
					<view class="title"><text class="title-city-text">备注</text></view>

					<input v-model="v.remarks" placeholder="请输入备注" :disabled="status==1||status==0" maxlength="20"
						type="text" />

				</view>
			</view>

			<view class="title-line">
				证件照片
			</view>
			<view class="show-title">身份证件</view>
			<view class="img-block">
				<view class="title">
					<text v-if="status!=1" style="color: red;">*</text>正面
				</view>
				<view class="right">
					<view class="add-opt" v-if="!identity_z"
						@click.stop="status==1||status==0?'':chooseImg('identity_z')"><text
							class="iconfont iconcamera_icon"></text></view>
					<image :src="identity_z" v-else @click.stop="status==1||status==0?'':chooseImg('identity_z')"
						mode="aspectFit">
					</image>
					<input type="text" v-show="false" name="identity_z" :value="identity_z" />
				</view>
			</view>
			<view class="img-block">
				<view class="title">
					<text v-if="status!=1" style="color: red;">*</text>反面
				</view>
				<view class="right">
					<view class="add-opt" v-if="!identity_f"
						@click.stop="status==1||status==0?'':chooseImg('identity_f')"><text
							class="iconfont iconcamera_icon"></text></view>
					<image :src="identity_f" v-else @click.stop="status==1||status==0?'':chooseImg('identity_f')"
						mode="aspectFit">
					</image>
					<input type="text" v-show="false" name="identity_f" :value="identity_f" />
				</view>
			</view>
			<view class="show-title">教学证件(至少选一项)</view>
			<view class="img-block">
				<view class="title">
					学生证
				</view>
				<view class="right">
					<view class="add-opt" v-if="!student_card"
						@click.stop="status==1||status==0?'':chooseImg('student_card')">
						<text class="iconfont iconcamera_icon"></text>
					</view>
					<image :src="student_card" v-else @click.stop="status==1||status==0?'':chooseImg('student_card')"
						mode="aspectFit"></image>
					<input type="text" v-show="false" name="student_card" :value="student_card" />
				</view>
			</view>
			<view class="img-block">
				<view class="title">
					教师证
				</view>
				<view class="right">
					<view class="add-opt" v-if="!teacher_card"
						@click.stop="status==1||status==0?'':chooseImg('teacher_card')">
						<text class="iconfont iconcamera_icon"></text>
					</view>
					<image :src="teacher_card" v-else @click.stop="status==1||status==0?'':chooseImg('teacher_card')"
						mode="aspectFit"></image>
					<input type="text" v-show="false" name="teacher_card" :value="teacher_card" />
				</view>
			</view>
			<view class="form-item" style="font-size: 25rpx;" v-if="status==-1||status==2">
				<view class="iconfont" style="margin-left: 25rpx;font-size: 45rpx;" @click.stop="clickAgree"
					:class="[selectAgree?'iconyuanxingxuanzhongfill':'iconyuanxingweixuanzhong']"
					:style="{color:selectAgree?$scss.themeColor:'#888'}"></view>
				<view style="margin-left: 25rpx;font-size: 25rpx;width: 510rpx;">
					<view style="display: flex;align-items: center;">
						我已阅读并同意
						<view class="title agree" style="width: auto;"
							@click.stop="$tools.toPage('pages/parse/parse?title=课程购买协议&k=key&val=courseAgreement&url='+$urls.getKvData)">
							《课程购买服务协议》
						</view>
					</view>
					<view style="display: flex;align-items: center;">
						和
						<view class="title agree" style="width: auto;"
							@click.stop="$tools.toPage('pages/parse/parse?title=教育服务协议&k=key&val=courseAgreement&url='+$urls.getKvData)">
							《教育协议》
						</view>
					</view>
					<view style="display: flex;align-items: center;">
						和
						<view class="title agree" style="width: auto;"
							@click.stop="$tools.toPage('pages/parse/parse?title=用户隐私协议&k=key&val=userPrivacy&url='+$urls.getKvData)">
							《用户隐私协议》
						</view>
					</view>
				</view>	
			</view>
			<view class="opt-block">
				<button type="default" class="btn" v-if="status==-1"
					form-type="submit">提交</button>
				<button type="default" class="btn" v-if="status==2" form-type="submit">修改提交</button>
			<!-- 	<button type="default" class="btn" v-if="status==1&&(interview_status==-1||interview_status==4)"
					@click.stop="updateStatus('interview_status',0)">约面试</button> -->
			</view>
		</form>
	</view>
</template>

<script>
	import $scss from "@/uni.scss"
	export default {
		components: {
			
		},
		data() {
			return {
				$scss: $scss,
				title:'个人设置',
				selectAgree: false,
				name: '',
				avatarUrl: '',
				phone: '',
				gender: '',
				region: ['湖南省', '长沙市', '雨花区'],
				address: '',
				userInfo:{},
			}
		},
		onLoad(e) {
				// let userInfo = uni.getStorageSync('userInfo')
				// let phone = uni.getStorageSync('phone')
				// if (!userInfo) {
				// 	uni.navigateBack()
				// 	return;
				// }
				// if (!userInfo.phone) {
				// 	uni.removeStorageSync('userInfo')
				// 	uni.navigateBack()
				// 	return;
				// }
				// this.userInfo = userInfo
				// this.phone = userInfo.phone
		},
		onShow() {
			// this.getUser()
			let userInfo = uni.getStorageSync('userInfo')
			this.phone = userInfo.phone
		},
		methods: {
			getUser(){
				this.$tools.req(this.$urls.getUser).then(res=>{
					if(res.code==200){
						this.userInfo = res.data
						this.phone = res.data.phone
						this.$forceUpdate()
						uni.setStorageSync('userInfo',res.data)
					}
				})
			},
			clickAgree() {
				this.selectAgree = !this.selectAgree
			},
			updateStatus(k, v) {
				this.$tools.req(this.$urls.updateStatus, {
					phone: this.phone,
					k,
					v
				}).then(res => {
					this.$pub.msg(res.msg)
					if (res.code == 200) {
						this.getResume()
					}
				})
			},
			getResume() {
				this.$tools.req(this.$urls.teacherResume, {
						phone: this.phone
					}).then(res => {
						uni.hideLoading();
						if (res.code == 200) {
							this.title ='我的简历'
							this.interview_time = res.data.interview_time;
							this.interview_status = res.data.interview_status;
							this.verify_time = res.data.verify_time;
							this.verify_remarks = res.data.verify_remarks;
							this.v_id = res.data.v_id;
							this.name = res.data.name;
							this.identity_card = res.data.identity_card;
							this.wechat = res.data.wechat;
							this.qq = res.data.qq;
							this.status = res.data.status;
							this.gender = res.data.gender;
							this.avatarUrl = res.data.avatarUrl;
							this.identity_z = res.data.identity_z;
							this.identity_f = res.data.identity_f;
							this.student_card = res.data.student_card;
							this.teacher_card = res.data.teacher_card;
							this.avatarUrl_old = res.data.avatarUrl;
							this.identity_z_old = res.data.identity_z;
							this.identity_f_old = res.data.identity_f;
							this.student_card_old = res.data.student_card;
							this.teacher_card_old = res.data.teacher_card;
							this.phone = res.data.phone;
							this.region = [res.data.province,res.data.city,res.data.area];
							this.address = res.data.address;
							this.edu_background = res.data.edu_background;
							this.teach_experience = res.data.teach_experience;
							this.self_evaluate = res.data.self_evaluate;
							this.win_award = res.data.win_award;
							this.teach_area = res.data.teach_area;
							this.teach_grade_title = res.data.teach_grade_title;
							this.teach_course_title = res.data.teach_course_title;
							this.teach_grade_type = res.data.teach_grade_type;
							this.teach_course_type = res.data.teach_course_type;
							this.free_time = res.data.free_time;
							if (this.teach_grade_title) {
								uni.setStorageSync('selectGrade', this.teach_grade_title.split(','))
							}
							if (this.teach_course_title) {
								uni.setStorageSync('selectCourse', this.teach_course_title.split(','))
							}
							if (this.teach_grade_type) {
								uni.setStorageSync('selectGradeType', this.teach_grade_type.split(','))
							}
							if (this.teach_course_type) {
								uni.setStorageSync('selectCourseType', this.teach_course_type.split(','))
							}
							if (this.teach_area) {
								uni.setStorageSync('selectArea', this.teach_area.split(','))
							}
							if (this.free_time) {
								uni.setStorageSync('selectTime', this.group(this.free_time.split(','), 7))
							}
						}
					})
					.catch(err => {
						uni.hideLoading();
						console.log(err);
						uni.navigateBack();
					});
			},
			group(array, subGroupLength) {
				let index = 0;
				let newArray = [];
				while (index < array.length) {
					newArray.push(array.slice(index, index += subGroupLength));
				}
				return newArray;
			},
			addTeachingExperience() {
				this.teach_experience.push({
					"student": "",
					"time": "",
					"remarks": "",
					"tutor_grade": "",
					"institution_title": ""
				})
			},
			addEduBackground() {
				this.edu_background.push({
					major: "",
					school: "",
					diploma: "",
					"date_end": "0000-00-00",
					"date_start": "0000-00-00"
				})
			},
			setData(e) {
				let data = e.currentTarget.dataset
				this[data.arr][data.k][data.field] = e.detail.value
			},
			del(arr, k) {
				this[arr].splice(k, 1)
			},
			setAddress(e) {
				this[e.currentTarget.dataset.k] = e.detail.value;
			},
			phoneInput(e) {
				this.phone = e.detail.value;
			},
			async updateData(e) {
				let data = e.detail.value; 
				if (!data.mp_openid) return this.$pub.msg('未绑定通知！');
				if (!data.name) return this.$pub.msg('姓名未填写');
				if (data.identity_card.length < 15) return this.$pub.msg('身份证填写不正确');
				if (!data.gender) return this.$pub.msg('性别未选择');
				if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(data.phone)) return this.$pub.msg('手机号输入不正确！');
				if (!data.wechat) return this.$pub.msg('微信未填写');
				if (!data.qq) return this.$pub.msg('QQ未填写');
				if (data.region == '省,市,区') return this.$pub.msg('省市区未选择');
				if (!data.address) return this.$pub.msg('地址未填写');
				if(data.self_evaluate){
					if (data.self_evaluate.length < 10) return this.$pub.msg('自我评价不能少于10个字');
				}
				if (!data.teach_grade_title) return this.$pub.msg('授课年级未选择');
				if (!data.teach_course_title) return this.$pub.msg('授课科目未选择');
				// if (!data.teach_area) return this.$pub.msg('授课区域未选择');
				if (!data.free_time) return this.$pub.msg('空闲时间未选择');
				if (!data.avatarUrl) return this.$pub.msg('头像未上传');
				if (!data.identity_z) return this.$pub.msg('身份证正面未上传');
				if (!data.identity_f) return this.$pub.msg('身份证反面未上传');
				if (!data.student_card && !data.teacher_card) return this.$pub.msg('学生证或教师证至少上传一个');
				if (!this.selectAgree) {
					this.$pub.msg('没有勾选服务协议?')
					return;
				}
				data.province = data.region.split(',')[0]
				data.city = data.region.split(',')[1]
				data.area = data.region.split(',')[2]
				data.teach_grade_type = this.teach_grade_type
				data.teach_course_type = this.teach_course_type
				data.edu_background = this.edu_background
				data.teach_experience = this.teach_experience
				try {
					for (let i = 0; i < data.edu_background.length; i++) {
						if (data.edu_background[i].date_start == '0000-00-00') {
							throw new Error('学历' + (i + 1) + ',开始时间未设置！')
						}
						if (data.edu_background[i].date_end == '0000-00-00') {
							throw new Error('学历' + (i + 1) + ',结束时间未设置！')
						}
						if (!data.edu_background[i].school) {
							throw new Error('学历' + (i + 1) + ',学校未填写！')
						}
						if (!data.edu_background[i].major) {
							throw new Error('学历' + (i + 1) + ',专业未填写！')
						}
						if (!data.edu_background[i].diploma) {
							throw new Error('学历' + (i + 1) + ',学历未填写！')
						}
					}
				} catch (e) {
					this.$pub.msg(e.message)
					return;
				}

				try {
					for (let i = 0; i < data.teach_experience.length; i++) {
						if (data.teach_experience[i].time == '') {
							throw new Error('经历' + (i + 1) + ',时间未填写！')
						}
						if (!data.teach_experience[i].tutor_grade) {
							throw new Error('经历' + (i + 1) + ',辅导年级未填写！')
						}
						if (!data.teach_experience[i].institution_title) {
							throw new Error('经历' + (i + 1) + ',机构名称未填写！')
						}
						if (!data.teach_experience[i].student) {
							throw new Error('经历' + (i + 1) + ',职务未填写！')
						}
					}
				} catch (e) {
					this.$pub.msg(e.message)
					return;
				}
				if(this.v_id){
					data.v_id = this.v_id;
				let res = await this.$tools.req(this.$urls.updateTeacher, data)
				if (res.code != 200) return this.$pub.msg(res.msg)
                }else{
					let res = await this.$tools.req(this.$urls.addTeacher, data)
					if (res.code != 200) return this.$pub.msg(res.msg)
					this.v_id = res.data.v_id;
				}
				try {
					if (this.avatarUrl && this.avatarUrl_old != this.avatarUrl) {
						await this.$tools.uploadImage(this.$urls.uploadTeacherImg + '?k=avatarUrl&v_id=' +
							this.v_id, this.avatarUrl)
					}
					if (this.identity_z && this.identity_z_old != this.identity_z) {
						await this.$tools.uploadImage(this.$urls.uploadTeacherImg + '?k=identity_z&v_id=' +
							this.v_id, this.identity_z)
					}
					if (this.identity_f && this.identity_f_old != this.identity_f) {
						await this.$tools.uploadImage(this.$urls.uploadTeacherImg + '?k=identity_f&v_id=' +
							this.v_id, this.identity_f)
					}
					if (this.student_card && this.student_card_old != this.student_card) {
						await this.$tools.uploadImage(this.$urls.uploadTeacherImg + '?k=student_card&v_id=' +
							this.v_id, this.student_card)
					}
					if (this.teacher_card && this.teacher_card_old != this.teacher_card) {
						await this.$tools.uploadImage(this.$urls.uploadTeacherImg + '?k=teacher_card&v_id=' +
							this.v_id, this.teacher_card)
					}
					this.updateStatus('status',0)
				} catch (e) {
					return this.$pub.msg(e.message)
				}
				this.$pub.msg('提交成功!')
			},
			chooseImg(opt) {
				uni.chooseImage({
					sizeType: 'compressed',
					count: 1,
					success: (res) => {
						this[opt] = res.tempFilePaths[0];
					}
				})
			},
			
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}
.agree {
			width: 650rpx;
			color: $themeColor !important;
		}

	.show-tips {
		font-size: 28rpx;
		color: #666;
		padding: 30rpx 0 0 30rpx;
	}

	.top {
		display: flex;
		align-items: center;
		padding: 0 30rpx;
		border-bottom: 1rpx solid #f0f0f0;

		.title {
			width: 130rpx;
			text-align: right;
			font-size: 28rpx;
			color: #333;
		}

		.right {
			margin-left: 145rpx;

			image {
				width: 150rpx;
				height: 150rpx;
				border-radius: 8rpx;
			}

			font-size: 30rpx;

			.add-opt {
				text-align: center;
				border: 1rpx #ccc dashed;
				border-radius: 8rpx;
				width: 150rpx;
				height: 150rpx;
				line-height: 150rpx;
				margin-bottom: 30rpx;

				.iconfont {
					font-size: 40rpx;
					color: #555;
				}
			}
		}

	}

	.form-item {
		background: #fff;
		border-bottom: 1rpx solid #f0f0f0;
		min-height: 100rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;

		.title {
			width: 140rpx;
			text-align: right;
			font-size: 28rpx;
			color: #333;
		}

		.phone {
			color: #444;
			font-size: 28rpx;
			width: 550rpx;
		}

		input {
			color: #555;
			font-size: 26rpx;
			width: 75%;
		}

		textarea {
			color: #555;
			font-size: 28rpx;
			width: 75%;
			border: 1rpx #f2f2f2 solid;
			border-radius: 4rpx;
			resize: none;
			height: 150rpx !important;
			padding: 10rpx;
			margin: 20rpx 0;
		}
	}

	.btn {
		background: $themeColor !important;
		font-size: 28rpx;
		color: #fff !important;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		border-radius: 8rpx;
		width: 690rpx;
		margin: 60rpx auto;
	}

	.show-title {
		display: flex;
		justify-content: space-between;
		padding: 25rpx 35rpx;
		background: #fff;
		border-bottom: 1rpx #eee solid;
		font-size: 28rpx;
		color: #333;
		margin-top: 20rpx;
	}

	.img-block {
		display: flex;
		align-items: center;
		padding: 25rpx 0;
		background: #fff;

		.title {
			width: 130rpx;
			text-align: right;
			font-size: 28rpx;
			color: #333;
		}

		.right {
			margin-left: 50rpx;

			.add-opt {
				text-align: center;
				border: 1rpx #ccc dashed;
				border-radius: 8rpx;
				width: 500rpx;
				height: 300rpx;
				margin-left: 30rpx;
				line-height: 265rpx;

				.iconfont {
					font-size: 100rpx;
					color: #888;
				}
			}

			image {
				width: 500rpx;
				height: 300rpx;
				border-radius: 8rpx;
				margin: 25rpx 25rpx 0 25rpx;
			}
		}
	}

	.title-line {
		margin: 35rpx 0;
		text-align: center;
		color: $themeColor;
	}

	.opt-btn {
		position: absolute;
		right: 30rpx;
		display: inline-block;
		font-size: 25rpx;
		padding: 5rpx 25rpx;
		border-radius: 4rpx;
		color: #fff;
		background: $themeColor;
	}
</style>